package demo1;

public class Test {
    public static void main(String[] args) {
        Student student1=new Student(12,"zit");
        Student student2=new Student(13,"hao");
        if(student1.compareTo(student2)>0  ){
            System.out.println("student1>student2");
        }
        else {
            System.out.println("student1<student2");
        }
        System.out.println("--------------------");
        NameCoparater nameCoparater=new NameCoparater();
        int ret=nameCoparater.compare(student1,student2);
     if (ret>0){
         System.out.println("student1>sudent2");
     }  else {
         System.out.println("sudent1<student2");
     }
        System.out.println("-----------------");
AgeComparater ageComparater=new AgeComparater();
int ret1=ageComparater.compare(student1,student2);
  if (ret1>0){
      System.out.println("student1>student2");
}else {
      System.out.println("student1<student2");
  }
    }
}
